package com.qijia.common.dao.impl;

import org.springframework.dao.DataAccessException;

public class DbException extends DataAccessException {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2513076563536584074L;

	/**
	 * Constructor for DataAccessException.
	 * 
	 * @param msg
	 *            the detail message
	 */
	public DbException(String msg) {
		super(msg);
	}

	/**
	 * Constructor for DataAccessException.
	 * 
	 * @param msg
	 *            the detail message
	 * @param cause
	 *            the root cause (usually from using a underlying data access
	 *            API such as JDBC)
	 */
	public DbException(String msg, Throwable cause) {
		super(msg, cause);
	}

	/**
	 * 
	 * @param mappId
	 *            sql mapped id
	 * @param obj
	 *            参数
	 * @param cause
	 *            异常
	 */
	public DbException(String mappId, Object obj, Throwable cause) {
		super("mapped ip[" + mappId + "] occur a error with object {"
				+ DbExceptionUtils.buildMessage(obj) + "}", cause);
	}
}
